#ifndef _Block
#define _Block

#include <windows.h>	// thread handles

#include <openssl/bn.h>
#pragma comment (lib, "libeay32.lib")

class Block {
public:
	HANDLE *handles;
	char *status;
	char *sindex;	// current index store
	char *index;
	int size;
	int counts[3];	// 0 = pending, 1 = active, 2 = complete

	Block *prev, *next;

	// Constructor
	Block(char* /*index*/, int /*size*/);
	// Deconstrucor
	~Block();

	// returns total number of todos in 'pending' state
	int getPending();
	// returns total number of todos in 'active' state
	int getActive();
	// returns total number of todos in 'complete' state
	int getComplete();

	// a thread is started, keep a tally
	bool thread_start();

	// a thread is complete, keep a tally
	bool thread_complete();

	// whether block is complete
	bool isComplete();

	// returns the next index to start
//	char* getNextIndex();

	// track the todo thread
//	bool track(HANDLE todo);

	// updates the status of todos
//	void update();

	// Find an active thread and watch it waiting for it to finish, return true
	// If unable to find an active thread, return false
//	bool waitForThread();
};

#endif // _Block